<include file="Common:minheader" />
<!-- /. NAV SIDE  -->
<form class="layui-form" action="">
	<input type="hidden" name='id' value="{$memberInfo.id}">
	<div class="layui-form-item">
		<label class="layui-form-label">用户名</label>
		<div class="layui-input-block">
		  <input value="{$memberInfo.login_name}" type="text" name="login_name" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">密码</label>
		<div class="layui-input-block">
		  <input type="password" name="login_pass" placeholder="请输入密码" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">姓名</label>
		<div class="layui-input-block">
			<input value="{$memberInfo.real_name}" type="text" name="real_name" required  lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">手机</label>
		<div class="layui-input-block">
		  <input value="{$memberInfo.telephone}" type="text" name="telephone" required  lay-verify="phone" placeholder="请输入手机" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">邮箱</label>
		<div class="layui-input-block">
		  <input value="{$memberInfo.email}" type="text" name="email" required  lay-verify="email" placeholder="请输入邮箱" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">角色</label>
		<div class="layui-input-block">
			<select name="role" lay-verify="required">
				<option value="">请选择</option>
				<notempty name="roleList">
					<volist name="roleList" id="vo">
						<option value="{$vo.id}" <if condition="($memberInfo['role'] eq $vo['id'])">selected</if>>{$vo.name}</option>
					</volist>
				</notempty>
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">状态</label>
		<div class="layui-input-block">
		  <input type="radio" name="status" value="1" title="激活" <if condition="$memberInfo.status eq 1">checked</if>>
		  <input type="radio" name="status" value="2" title="停用" <if condition="$memberInfo.status eq 2">checked</if>>
		  <input type="radio" name="status" value="0" title="删除" <if condition="$memberInfo.status eq 0">checked</if>>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
		  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
		  <button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
    </div>
</form>
<script>
	//Demo
	layui.use('form', function(){
	  var form = layui.form;
	  //监听提交
	  form.on('submit(formDemo)', function(data){
			var cont = data.field;
			$.ajax({
				url:"{:U('member/updateMember')}",
				type:'post',
				dataType:'json',
				data:cont,
				success:function(data){
					if(data.code==0){
						layer.alert(data.message);
					}else{
						layer.alert(data.message, function(index){
							//do something
							window.parent.location.reload();
							var index = parent.layer.getFrameIndex(window.name); 
							parent.layer.close(index);
						});
					}
				}
			});
			//layer.msg(JSON.stringify(data.field));
			return false;
	  });
	});
</script>
<!-- /. PAGE INNER  -->
<include file="Common:footer" />
    